<section class="vbox">
	<section class="scrollable w-f">
		<section class="row">
			<div class="col-sm-6">
				<el-input placeholder="关键字搜索" size="medium" v-model="params.searchValue" class="input-with-select">
					<el-select v-model="params.searchKey" slot="prepend" placeholder="请选择">
						<el-option v-for="item in searchParams" :label="item.name" :value="item.value"></el-option>
					</el-select>
					<el-button @click="queryList(1)" slot="append" icon="el-icon-search"></el-button>
				</el-input>
			</div>
		</section>
		<section class="m-t">
			<el-button @click="uploadFileVisible = true" size="small" icon="el-icon-circle-plus-outline" plain>新增</el-button>
			<el-button @click="delFileByIds" size="small" icon="el-icon-delete" type="danger" plain>删除</el-button>
			<el-button @click="modifyFileName" size="small" icon="el-icon-edit" type="success" plain>修改文件名</el-button>
			<el-button @click="modifyPublicState" size="small" icon="el-icon-edit" type="success" plain>修改公用状态</el-button>
			<el-button @click="downloadFile" size="small" icon="el-icon-download" type="primary" plain>下载</el-button>
		</section>
		<el-dialog title="提示" :visible.sync="uploadFileVisible">
			<el-upload ref="upload" limit="1" :on-success="fileUploadHandleSuccess" :action="fileUploadAction" :file-list="fileList" :auto-upload="false" :with-credentials="true">
				<el-button slot="trigger" size="small" type="primary">选取文件</el-button>
				<div slot="tip" class="el-upload__tip">只能上传单个文件</div>
			</el-upload>
			<span slot="footer" class="dialog-footer">
				<el-button size="small" @click="uploadFileVisible = false">取 消</el-button>
				<el-button size="small" type="primary" @click="$refs.upload.submit()">确 定</el-button>
			</span>
		</el-dialog>
		<section class="m-t">
			<el-table :data="data.list" tooltip-effect="dark" style="width: 100%" @selection-change="handleSelectionChange">
				<el-table-column type="selection" width="45"></el-table-column>
				<el-table-column type="expand">
					<template slot-scope="props">
						<div class="form-horizontal">
							<div class="form-group" v-if="props.row.fileType.indexOf('image') > -1">
								<label class="col-sm-2 control-label">缩略图</label>
								<div class="col-sm-10">
									<img class="box-shadow" height="100" :src="urlParams.projectPath + 'file/' + props.row.id + urlParams.suffix" />
								</div>
							</div>
							<div class="form-group" v-for="item in fileInfoField">
								<label class="col-sm-2 control-label">{{item.name}}</label>
								<div class="col-sm-10">
									<p class="form-control-static">{{props.row[item.field]}}</p>
								</div>
							</div>
						</div>
					</template>
				</el-table-column>
				<el-table-column prop="fileName" label="文件名" show-overflow-tooltip></el-table-column>
				<el-table-column prop="fileType" label="文件类型" show-overflow-tooltip></el-table-column>
				<el-table-column label="文件大小" width="100">
					<template slot-scope="scope">{{ calculateStorageSize(scope.row.fileSize,0) }}</template>
				</el-table-column>
				<el-table-column prop="fileSuffix" width="100" label="文件名后缀" show-overflow-tooltip></el-table-column>
				<el-table-column label="是否公用" width="80">
					<template slot-scope="scope">{{ scope.row.isPublic==1?"公用":"不公用" }}</template>
				</el-table-column>
				<el-table-column prop="visitNum" label="访问次数" width="100"></el-table-column>
				<el-table-column prop="downloadNum" label="下载成功次数" width="110"></el-table-column>
				<el-table-column prop="createDate" label="上传日期" width="140"></el-table-column>
			</el-table>
		</section>
	</section>
	<footer class="text-center">
		<paging :pagingParams="data" @clickFun="queryList"></paging>
	</footer>
</section>